package com.google;

import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class ResponseHandler
{
  private static final String TAG = "ResponseHandler";
  private static PurchaseObserver sPurchaseObserver;

  public static void buyPageIntentResponse(PendingIntent paramPendingIntent, Intent paramIntent)
  {
    if (sPurchaseObserver == null)
    {
      Log.d("ResponseHandler", "UI is not running");
      return;
    }
    sPurchaseObserver.startBuyPageActivity(paramPendingIntent, paramIntent);
  }

  public static void checkBillingSupportedResponse(boolean paramBoolean)
  {
    if (sPurchaseObserver != null)
      sPurchaseObserver.onBillingSupported(paramBoolean);
  }

  public static void purchaseResponse(Context paramContext, final Consts.PurchaseState paramPurchaseState, final String paramString1, final String paramString2, final long paramLong, String paramString3)
  {
    new Thread(new Runnable()
    {
      public void run()
      {
        PurchaseDatabase localPurchaseDatabase = new PurchaseDatabase(this.val$context);
        int i = localPurchaseDatabase.updatePurchase(paramString2, paramString1, paramPurchaseState, paramLong, this.val$developerPayload);
        localPurchaseDatabase.close();
        try
        {
          if (ResponseHandler.sPurchaseObserver != null)
            ResponseHandler.sPurchaseObserver.postPurchaseStateChange(paramPurchaseState, paramString1, i, paramLong, this.val$developerPayload);
          return;
        }
        finally
        {
        }
      }
    }).start();
  }

  public static void register(PurchaseObserver paramPurchaseObserver)
  {
    try
    {
      sPurchaseObserver = paramPurchaseObserver;
      return;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  public static void responseCodeReceived(Context paramContext, BillingService.RequestPurchase paramRequestPurchase, Consts.ResponseCode paramResponseCode)
  {
    if (sPurchaseObserver != null)
      sPurchaseObserver.onRequestPurchaseResponse(paramRequestPurchase, paramResponseCode);
  }

  public static void responseCodeReceived(Context paramContext, BillingService.RestoreTransactions paramRestoreTransactions, Consts.ResponseCode paramResponseCode)
  {
    if (sPurchaseObserver != null)
      sPurchaseObserver.onRestoreTransactionsResponse(paramRestoreTransactions, paramResponseCode);
  }

  public static void unregister(PurchaseObserver paramPurchaseObserver)
  {
    try
    {
      sPurchaseObserver = null;
      return;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.google.ResponseHandler
 * JD-Core Version:    0.6.2
 */